﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace MyHotel.Report
{
    public partial class frmReviewHoaDonThanhToan : Form
    {
        string tenphong;
        string ngayvao;
        string ngayra;
        string tienphong;
        string tongtiendichvu;
        List<DichVu> dataSource;

        public frmReviewHoaDonThanhToan(string ten, string nvao, string nra, string tphong, string tdv, List<DichVu> l)
        {
            tenphong = ten;
            ngayvao = nvao;
            ngayra = nra;
            tienphong = tphong;
            tongtiendichvu = tdv;
            dataSource = l;

            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            try
            {
                List<ReportParameter> param = new List<ReportParameter>();
                param.Add(new ReportParameter("TenPhong", tenphong));
                param.Add(new ReportParameter("NgayVao", ngayvao));
                param.Add(new ReportParameter("NgayRa", ngayra));
                param.Add(new ReportParameter("TienPhong", tienphong));
                param.Add(new ReportParameter("TongTienDichVu", tongtiendichvu));
                reportViewer1.LocalReport.SetParameters(param);
                DichVuBindingSource.DataSource = dataSource;
                this.reportViewer1.RefreshReport();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            } 
        }
    }
}
